#include "ThreadPool.hpp"
#include <chrono>
#include <iostream>

int main() {
    ThreadPool pool(std::thread::hardware_concurrency());

    auto future1 = pool.enqueue([] { return 42; });

    auto future2 = pool.enqueue([](int a, int b) {
        std::this_thread::sleep_for(std::chrono::milliseconds(200));
        return a + b;
    }, 3, 7);

    std::cout << "Result1: " << future1.get() << '\n';
    std::cout << "Result2: " << future2.get() << '\n';

    pool.shutdown(); // 可显式调用（可选），析构也会自动执行

    return 0;
}